﻿(self.webpackChunkvk=self.webpackChunkvk||[]).push([[85820],{428817:t=>{t.exports={reactions_preview_item:'<div class="ReactionsPreviewItem ReactionsPreviewItem--stackOverlay %class%" style="background-image: url(\'%image_url%\');" aria-label="%title%"></div>'}},700251:(t,e,n)=>{"use strict";n.d(e,{once:()=>i});var i=function(t){var e=!1;return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(!e)return e=!0,t.apply(this,n)}}},70162:(t,e,n)=>{"use strict";function i(t,e){for(var n in e)if(e.hasOwnProperty(n)){var i="{"+n+"}";t=t.replace(i,e[n])}return t}function r(t,e,n,i){return void 0===i&&(i="tag"),n=(n=n.replace("{"+i+"}",t)).replace("{/"+i+"}",e)}n.d(e,{langReplace:()=>i,langTag:()=>r})},613327:(t,e,n)=>{"use strict";n.d(e,{preservePositionBetween:()=>o});var i=n(830104),r=n(700251);function o(t,e){var n=(void 0===e?{}:e).scrollByImpl,o=void 0===n?window.scrollBy:n,a=t;return{start:(0,r.once)((function(t){t&&(a=t);var e=(0,i.getElementOffset)(a);return(0,r.once)((function(t){if(t&&(a=t),a.isConnected){var n=(0,i.getElementOffset)(a);o(0,n.top-e.top)}}))}))}}},819633:(t,e,n)=>{"use strict";n.d(e,{loadAnimationConfigurable:()=>r,getAnimation:()=>o,onAnimationReady:()=>a,destroyAnimationItem:()=>u});var i=n(570655),r=function(t){return function(e){var n,r,o=e.animationData,a=e.animationURL,u=e.container,s=e.loadAnimationParams,c=void 0===s?{}:s,l=o?{animationData:o}:{path:a},d={renderer:"svg",autoplay:null!==(n=null==c?void 0:c.autoplay)&&void 0!==n&&n,loop:null===(r=null==c?void 0:c.loop)||void 0===r||r,rendererSettings:{progressiveLoad:!0}},v=(0,i.__assign)((0,i.__assign)((0,i.__assign)({},l),d),{container:u});return t.loadAnimation(v)}},o=function(t){var e=t.animationDataGet,n=t.animationDataSet,i=t.loadAnimation;return function(t,r,o){var a=t,u=e?e({animationId:a}):void 0,s=i({animationData:u,animationURL:t,container:r,loadAnimationParams:null==o?void 0:o.loadAnimationParams});return!u&&n&&function(t,e){t.addEventListener("data_ready",(function(){e(t.animationData)}))}(s,(function(t){n({animationId:a,loadedAnimationData:t})})),s}};function a(t,e){t.isLoaded?e():t.addEventListener("DOMLoaded",(function(){e()}))}function u(t){var e=function(t){return!t._cbs}(t);e||t.destroy()}},508271:(t,e,n)=>{"use strict";n.d(e,{HIDE_TOOLTIP_TIMEOUT:()=>i,SHOW_TOOLTIP_TIMEOUT:()=>r,REACTION_ID_DEFAULT:()=>o,REACTION_ID_MAX:()=>a,REACTION_ID_MIN:()=>u,REACTION_ID_UNSET:()=>s,REACTION_SET_ITEMS_MIN_COUNT:()=>c,OPENED_REACTED_USERS_DEFAULT_REACTION_ID:()=>l});var i=600,r=140,o=0,a=7,u=0,s=void 0,c=2,l=o},464746:(t,e,n)=>{"use strict";n.d(e,{isDebugEnabled:()=>o});var i=n(26330),r=void 0,o=function(){return void 0!==r?r:r=!!i.default.get("reactions.debug_enabled")}},714396:(t,e,n)=>{"use strict";n.d(e,{reactionCountsBrandUnwrap:()=>r,reactionCountsBrandWrap:()=>o});var i=n(165594),r=function(t){return(0,i.unwrap)(t)},o=function(t){return(0,i.wrap)(t)}},82701:(t,e,n)=>{"use strict";n.d(e,{reactionLogError:()=>r});var i=n(66433);function r(t){var e=t.error,n=t.reportError;void 0!==n&&n&&(0,i.logError)(e,{environment:"reactions"}),console.error(e)}},517760:(t,e,n)=>{"use strict";n.d(e,{isUnknownObject:()=>s,getReaction:()=>c,getDefaultReaction:()=>l,getDefaultReactionTitle:()=>d,prepareReactionMenuSet:()=>f,isReactionIdSet:()=>g,isReactionIdUnset:()=>m,isValidReactionId:()=>p,parseReactionId:()=>_,parseReactionIdOrUnset:()=>R,validateReactionSetPayloaditems:()=>w,parseReactionMenuConfig:()=>b,calcCounters:()=>I,calcCountersSum:()=>S,calcCountersWeightedSum:()=>E,hasReactionsForCounts:()=>y,counterForReactionId:()=>A,areCountersEqual:()=>P});var i=n(570655),r=n(508271),o=n(714396),a=n(659397),u=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},s=function(t){return null!==t&&"object"==typeof t},c=function(t,e){return t.itemsById[e]},l=function(t){return c(t,r.REACTION_ID_DEFAULT)},d=function(t){var e;return null===(e=l(t))||void 0===e?void 0:e.title},v=function(t,e){return 0===t.length?"":(n=t,i=function(t){return Math.pow(e.width-t.width,2)+Math.pow(e.height-t.height,2)},r=!1,void 0===r&&(r=!0),n.reduce((function(t,e){var n=i(e),o=i(t);return o===n?r?t:e:o<n?t:e}))).url;var n,i,r},f=function(t,e,n){var i=e.map((function(t){var e=t.asset,i=t.color_sets,r=t.id,o=t.score,a=t.title;return{animationURL:e.animation_url||void 0,backgroundColor:null==i?void 0:i.background,id:r,imageMenuURL:v(e.images,n.imageMenuSize),imagePreviewURL:"imagePreviewSize"in n?v(e.images,n.imagePreviewSize):void 0,imageStoryPanelURL:"imageStoryPanelSize"in n?v(e.images,n.imageStoryPanelSize):void 0,imageStoryPreviewURL:"imageStoryPreviewSize"in n?v(e.images,n.imageStoryPreviewSize):void 0,score:o,title:a,titleColor:null==i?void 0:i.foreground}})),r={};return i.forEach((function(t){r[t.id]=t})),{id:t,items:i,itemsById:r}},g=function(t){return t!==r.REACTION_ID_UNSET},m=function(t){return t===r.REACTION_ID_UNSET},p=function(t){return u(t)&&t>=r.REACTION_ID_MIN&&t<=r.REACTION_ID_MAX},_=function(t){var e=parseInt(t,10);return p(e)?{isValid:!0,value:e}:{isValid:!1}},R=function(t){var e=_(t);return e.isValid?e.value:r.REACTION_ID_UNSET},w=function(t,e){if(t.length<r.REACTION_SET_ITEMS_MIN_COUNT)return{error:new Error("Invalid reactions items count in set '"+e+"': "+t.length)}},b=function(t){if(s(t)){var e={},n=t.animationShowStaticAfterEnd,i=t.menuShowDelay,o=t.openedDefaultReactionId,a=t.reportJsErrors;return"number"!=typeof i&&void 0!==i||(e.menuShowDelay=i),"boolean"==typeof n&&(e.animationShowStaticAfterEnd=n),"boolean"==typeof a&&(e.reportJsErrors=a),"number"==typeof o||null===o?null===o?e.openedDefaultReactionId=void 0:p(o)&&(e.openedDefaultReactionId=o):e.openedDefaultReactionId=r.OPENED_REACTED_USERS_DEFAULT_REACTION_ID,e}},I=function(t,e){var n=(0,o.reactionCountsBrandWrap)({});return Object.entries((0,o.reactionCountsBrandUnwrap)(t)).forEach((function(t){var r,o,a,u=(0,i.__read)(t,2),s=u[0],c=u[1],l=s,d=null!==(a=null===(o=null===(r=null==e?void 0:e.itemsById)||void 0===r?void 0:r[l])||void 0===o?void 0:o.score)&&void 0!==a?a:1;n[l]=d*(c||0)})),n},S=function(t){return Object.values((0,o.reactionCountsBrandUnwrap)(t)).reduce((function(t,e){return t+(e||0)}),0)},E=function(t){return S((0,o.reactionCountsBrandWrap)(t))},y=function(t){return S(t)>0},A=function(t,e){var n;return null!==(n=t[e])&&void 0!==n?n:void 0},P=function(t,e){return t&&e?(0,a.isEqual)(t,e):t===e}},165594:(t,e,n)=>{"use strict";n.d(e,{unwrap:()=>i,wrap:()=>r});var i=function(t){return t},r=function(t){return t}},964141:(t,e,n)=>{"use strict";n.d(e,{stripPercentVars:()=>i});var i=function(t){return t.replace(/%[-\w]+%/g,"")}},93682:(t,e,n)=>{"use strict";n.d(e,{ATTR_USER_REACTION_ID:()=>i});var i="data-reaction-user-reaction-id"},330752:(t,e,n)=>{"use strict";n.d(e,{updateReactionButtonContainerForCounts:()=>E,updateReactionButtonForCurrentReaction:()=>y,updateReactionButtonCounts:()=>A,getLastOwnReactionChangeTime:()=>P,setDataCurrentId:()=>C});var i=n(570655),r=n(40906),o=(n(830104),n(70162)),a=n(819633),u=n(464746),s=n(517760),c=n(315544),l=n(635676),d=n(786067),v=n(93682),f=n(646346),g=n(808591),m=n(672544),p=n(385667),_="data-reaction-last-own-change-time",R="PostButtonReactions__icon--animationActive";var w=function(t){var e,n=null===(e=t.__reactionIconAnimation)||void 0===e?void 0:e.animationItem;n&&(!n._cbs||n.destroy(),delete t.__reactionIconAnimation)},b=function(t,e,n,i){var r;if(!(t!==(null===(r=n.__reactionIconAnimation)||void 0===r?void 0:r.animationURL))&&t||(w(n),e.innerHTML="",n.classList.remove(R)),i&&t){var o=(0,f.getAnimation)(t,e,{loadAnimationParams:{autoplay:!0,loop:!1}});(0,a.onAnimationReady)(o,(function(){n.classList.add(R)}));o.addEventListener("complete",(function(){var t;!0===(null==(t=(0,p.getReactionConfig)())?void 0:t.animationShowStaticAfterEnd)&&(n.classList.remove(R),w(n))})),n.__reactionIconAnimation={animationItem:o,animationURL:t}}},I=function(t,e){var n=t.querySelector('[data-section-ref="reactions-button-icon"]');if(n){var i=e.currentOption,r=e.isUserAction;if(i.isReactionSet){var o=i.current,a=null==o?void 0:o.imageMenuURL;n.style.backgroundImage="url('"+a+"')",n.setAttribute("aria-label",null==o?void 0:o.title)}else{var u=i.default;n.style.backgroundImage="",(null==u?void 0:u.title)&&n.setAttribute("aria-label",null==u?void 0:u.title)}n.classList.toggle("PostButtonReactions__icon--custom",i.isReactionSet);var s=i.isReactionSet?i.current.animationURL:void 0,l=function(t){var e=t.querySelector(".PostButtonReactions__iconAnimation");return e||(e=(0,c.se)('<div class="PostButtonReactions__iconAnimation" data-section-ref="reactions-button-icon-animation"></div>'),t.appendChild(e),e)}(n);b(s,l,n,r)}},S=function(t,e,n){t.classList.toggle("PostButtonReactions--icon-active",e),t.classList.toggle("PostButtonReactions--active",e)},E=function(t,e){var n=!e||!(0,s.hasReactionsForCounts)(e);t.classList.toggle("PostBottomAction--empty",n)},y=function(t,e,n,r){var a=!(0,s.isReactionIdUnset)(e),c=function(t,e){var n=(0,s.getDefaultReaction)(t),i=void 0;if((0,s.isReactionIdUnset)(e)){if(n)return{isReactionSet:!1,default:n}}else{if(i=t.itemsById[e])return{isReactionSet:!0,current:i};console.error(new Error("Missing reaction meta for "+e+" in set '"+t.id+"'"))}return{_error:!0}}(n,e);"_error"in c||(I(t,{currentOption:c,isUserAction:r}),function(t,e){var n=e.currentOption,r=n.isReactionSet?n.current.titleColor:void 0,o=n.isReactionSet?n.current.backgroundColor:void 0,a=r?{"--reaction-button-title-color-light":r.light,"--reaction-button-title-color-dark":r.dark}:{"--reaction-button-title-color-light":null,"--reaction-button-title-color-dark":null},u=o?{"--reaction-button-background-color-light":o.light,"--reaction-button-background-color-dark":o.dark}:{"--reaction-button-background-color-light":null,"--reaction-button-background-color-dark":null},s=(0,i.__assign)((0,i.__assign)({},a),u);Object.entries(s).forEach((function(e){var n=(0,i.__read)(e,2),r=n[0],o=n[1];t.style.setProperty(r,o)}))}(t,{currentOption:c}),function(t,e){var n=e.currentOption,i="";i=n.isReactionSet?(0,o.langReplace)((0,d.getLang)("reactions_button_unset_reaction_title")||"",{reaction_name:n.current.title||""}):(0,o.langReplace)((0,d.getLang)("reactions_button_set_reaction_with_name")||"",{reaction_name:n.default.title||""})||(0,d.getLang)("reactions_button_title")||"",t.setAttribute("aria-label",i||"")}(t,{currentOption:c}),(0,g.isCounterEnabledForBtn)(t)||function(t,e){var n=t.querySelector('[data-section-ref="reactions-button-title"]');if(n){var i=e.currentOption,r=i.isReactionSet?i.current.title:i.default.title;r?n.innerText=r:(0,u.isDebugEnabled)()&&console.log("reactions: setReactionNameTitle: missing title",i)}}(t,{currentOption:c})),S(t,a),r&&function(t,e){t.setAttribute(_,String(e))}(t,Date.now())},A=function(t,e,n,i,r){var o=(0,g.getCounterForTitle)(t,e,i,r);(0,g.isCounterEnabled)(o)&&(function(t,e){var n=t.querySelector('[data-section-ref="reactions-button-title"]');if(n){var i=e.counterForTitle;if((0,g.isCounterAvailable)(i)){var r=i.buttonText;(0,l.animateCount)(n,r,{allowZero:i.allowZeroAnimation,str:!0,noWrapWidth:!0,noSpaceIfEmpty:!0})}else(0,u.isDebugEnabled)()&&console.log("reactions: setReactionTitle: missing title",i)}}(t,{counterForTitle:o}),i&&function(t,e){var n,i=null===(n=(0,m.getClosestLikeBtnContainerElem)(t))||void 0===n?void 0:n.querySelector('[data-section-ref="reactions-button-screen-reader-counter"]');if(i){var r=(0,d.langNumeric)(e,(0,d.getLang)("reactions_n_reacted","raw")||"%s",!0);i.innerText=r}}(t,(0,s.calcCountersSum)(i)))},P=function(t){var e=t.getAttribute(_);if(e&&(0,r.isNumeric)(e))try{return new Date(Number.parseInt(e)).getTime()||void 0}catch(t){return void console.error(t)}};var C=function(t,e){t.setAttribute(v.ATTR_USER_REACTION_ID,(0,s.isReactionIdUnset)(e)?"":String(e))}},1925:(t,e,n)=>{"use strict";n.d(e,{TitleVariantWithLikedUsers:()=>i,TITLE_VARIANT_DEFAULT:()=>r,ReactionMenuTitleVariants:()=>o});var i="WithLikedUsers",r=i,o=[i,"TitleOnly"]},54789:(t,e,n)=>{"use strict";n.d(e,{ButtonStyleVariant:()=>i});var i={Post:"post",Reply:"reply"}},52521:(t,e,n)=>{"use strict";n.d(e,{renderPreviewItems:()=>d});var i=n(570655),r=n(517760),o=n(483295),a=n(315544),u=n(428817),s=n.n(u),c=n(54789),l=n(385667),d=function(t,e,n,u,d){var v=function(t,e,n){var o,a;void 0===n&&(n=!1);var u=[];try{for(var s=(0,i.__values)(Object.keys(t)),c=s.next();!c.done;c=s.next()){var l=c.value,d=(0,r.parseReactionId)(l);d.isValid&&t[d.value]>0&&u.push(d.value)}}catch(t){o={error:t}}finally{try{c&&!c.done&&(a=s.return)&&a.call(s)}finally{if(o)throw o.error}}return u=u.sort((function(e,n){return(t[n]||0)-(t[e]||0)})).slice(0,e),n&&u.reverse(),u}(e,3),f=t.querySelector(".ReactionsPreview__items"),g=(0,l.getReactionSet)(n),m=0===(0,r.calcCountersSum)(e),p=s().reactions_preview_item;f&&g&&"string"==typeof p?(f.innerHTML=v.map((function(t){var e=g.itemsById[t];if(!e)return"";var n=(0,o.classNames)({"ReactionsPreviewItem--lite ReactionsPreviewItem--stackOverlayLite":d===c.ButtonStyleVariant.Reply,"ReactionsPreviewItem--post ReactionsPreviewItem--stackOverlayPost":d===c.ButtonStyleVariant.Post});return(0,a.rs)(p,{image_url:e.imagePreviewURL,title:e.title,class:n})})).join(""),t.classList.toggle("ReactionsPreview--empty",m),t.classList.toggle("ReactionsPreview--active",void 0!==u)):console.warn("Unable to render reaction previews",{itemsContainer:f,previewItemTemplate:p,reactionSet:g})}},646346:(t,e,n)=>{"use strict";n.d(e,{animationItemHasData:()=>u,getAnimation:()=>s});var i=n(791963),r=n(819633),o=(0,n(469687).makeSharedState)("reactions-animations-storage",(function(){return{animationItemsData:new Map}})),a=function(){return o().animationItemsData},u=function(t){return a().has(t)},s=(0,r.getAnimation)({animationDataGet:function(t){var e=t.animationId;return a().get(e)},animationDataSet:function(t){var e=t.animationId,n=t.loadedAnimationData;a().set(e,n)},loadAnimation:(0,r.loadAnimationConfigurable)(i.default)})},485207:(t,e,n)=>{"use strict";n.d(e,{isDebugEnabled:()=>i.isDebugEnabled,ENABLED_IN_POST_REPLY:()=>r});var i=n(464746),r=!1},808591:(t,e,n)=>{"use strict";n.d(e,{isCounterEnabledForBtn:()=>o,getCounterForTitle:()=>a,isCounterEnabled:()=>u,isCounterAvailable:()=>s});var i=n(517760),r=n(786067),o=function(t){return!!t.getAttribute("data-reaction-button-text-is-counter")};function a(t,e,n,a){if(!o(t))return{kind:"disabled"};if(!n)return{kind:"error"};var u=0!==(a?(0,i.calcCountersSum)(a):0);if(!(0,i.hasReactionsForCounts)(n))return{kind:"enabled",allowZeroAnimation:u,buttonText:""};var s=(0,i.calcCounters)(n,e),c=(0,i.calcCountersWeightedSum)(s);return{kind:"enabled",allowZeroAnimation:u,buttonText:(0,r.langNumeric)(c,"%s",!0)}}function u(t){return!!t&&"disabled"!==t.kind}function s(t){return"enabled"===t.kind}},892239:(t,e,n)=>{"use strict";n.d(e,{addDataUpdateListener:()=>a,emitDataUpdate:()=>u,addReactionChooseListener:()=>s,emitReactionChoose:()=>c});var i=n(761508),r=(0,n(469687).makeSharedState)("reactions-menu-events",(function(){return{emitter:new i.default}})),o=function(){return r().emitter},a=function(t,e){var n,i=o(),r=((n={})[t+":data_update"]=e,n);return i.addListeners(r),function(){i.removeListeners(r)}},u=function(t,e){o().emit(t+":data_update",e)},s=function(t,e){var n,i=o(),r=((n={})[t+":reaction_choose"]=e,n);return i.addListeners(r),function(){i.removeListeners(r)}},c=function(t){o().emit(t+":reaction_choose")}},301718:(t,e,n)=>{"use strict";n.d(e,{getPreviewVariantForLikeBtn:()=>g,reactionsElemPayload:()=>m,shouldReactionsPreviewBeVisible:()=>p,updateReactionsPreview:()=>R,updateReactionsButtonForCounts:()=>w});var i=n(520820),r=n(517760),o=n(635676),a=n(786067),u=n(385667),s=n(672544),c=n(740672),l=n(908706),d=n(52521),v=n(93682),f=function(t){var e=t.getAttribute("data-reaction-counts");if(null===e)return{};var n=e?(0,i.parseJSON)(e):void 0;return"object"==typeof n&&null!==n?n:void 0},g=function(t){var e=t.getAttribute("data-reaction-preview-variant");if(e)return(0,l.parsePreviewVariant)(e)},m=function(t){var e=t.getAttribute("data-reaction-target-object"),n=t.getAttribute("data-reaction-hash"),i=t.getAttribute("data-reaction-set-id");if(null!==i){var o=t.getAttribute(v.ATTR_USER_REACTION_ID),a=o?(0,r.parseReactionIdOrUnset)(o):void 0,u=t.getAttribute("data-reaction-style-variant"),s=u&&(0,c.isValidButtonStyleVariant)(u)?u:void 0,l=t.getAttribute("data-reaction-menu-title-variant"),d=l&&(0,c.isValidButtonTitleVariant)(l)?l:void 0,m=g(t);return{counts:f(t),csrfHash:n,objectRaw:e,reactionSetId:i,styleVariant:s,titleVariant:d,userReactionId:a,previewVariant:m}}},p=function(t){return(0,r.hasReactionsForCounts)(t)},_=function(t,e){var n=e.counts,i=e.countsPrevious,c=e.objectRaw,l=e.reactionId,v=e.reactionSetId,f=e.styleVariant,g=(0,u.getReactionSet)(v),m=(0,r.calcCounters)(n,g),p=(0,r.calcCountersWeightedSum)(m),_=(0,r.calcCountersSum)(n),R=i?(0,r.calcCountersSum)(i):0,w=(0,s.getPreviewElem)(c);w&&((0,d.renderPreviewItems)(w,n,v,l,f),function(t,e,n,i){var r,u,s=(0,a.langNumeric)(n,(0,a.getLang)("reactions_n_reacted","raw")||"%s",!0);t.setAttribute("aria-label",s);var c=function(t){var e;return null!==(e=t.querySelector('[data-section-ref="like-button-count"]'))&&void 0!==e?e:void 0}(t);if(c){t.tt&&"object"==typeof t.tt&&(t.tt.shown||t.tt.showing||null===(u=null===(r=t.tt)||void 0===r?void 0:r.destroy)||void 0===u||u.call(r));var l=(0,a.langNumeric)(e,"%s",!0);(0,o.animateCount)(c,l,{allowZero:0!==i,str:!0,noWrapWidth:!0,noSpaceIfEmpty:!0})}}(w,p,_,R))},R=function(t,e){var n=(0,s.getLikeBtnElem)(t),i=e.counts;n&&i?function(t,e,n){var i=m(t);i&&i.objectRaw&&_(0,{counts:e,countsPrevious:n,objectRaw:i.objectRaw,reactionId:i.userReactionId,reactionSetId:i.reactionSetId,styleVariant:i.styleVariant})}(n,i,e.countsPrevious):console.warn("Unable to update object reactions",{objectRaw:t,options:e})},w=function(t,e){var n=e.counts,i=(0,s.getLikeBtnElem)(t);i&&function(t,e){t.setAttribute("data-reaction-counts",JSON.stringify(e))}(i,n)}},582982:(t,e,n)=>{"use strict";n.d(e,{reactionLogError:()=>o});var i=n(82701),r=n(385667),o=function(t){var e,n=t.error,o=(0,r.getReactionConfig)(),a=null!==(e=null==o?void 0:o.reportJsErrors)&&void 0!==e&&e;(0,i.reactionLogError)({error:n,reportError:a})}},672544:(t,e,n)=>{"use strict";n.d(e,{getLikeBtnElem:()=>i,getClosestLikeBtnContainerElem:()=>r,getLikeWrap:()=>o,getMenuMount:()=>a,getPreviewElem:()=>u});var i=function(t){var e;return null!==(e=document.querySelector('[data-section-ref="reactions-button"][data-reaction-target-object="'+t+'"]'))&&void 0!==e?e:void 0},r=function(t){var e;return null!==(e=t.closest('[data-section-ref="reactions-button-container"]'))&&void 0!==e?e:void 0},o=function(t){var e,n=i(t);if(n)return null!==(e=n.closest(".like_wrap"))&&void 0!==e?e:void 0},a=function(t){var e,n;return null!==(n=null===(e=t.closest('[data-section-ref="reactions-button-container"]'))||void 0===e?void 0:e.querySelector('[data-section-ref="reactions-menu-mount"]'))&&void 0!==n?n:null},u=function(t){return document.querySelector('[data-section-ref="reactions-preview-items"][data-reaction-target-object="'+t+'"]')}},385667:(t,e,n)=>{"use strict";n.d(e,{storageAddSets:()=>v,getReactionSet:()=>f,storageSetConfig:()=>g,getReactionConfig:()=>m});var i=n(570655),r=n(449849),o=n(517760),a=n(469687),u=n(582982),s=n(95146),c=n(485207),l=(0,a.makeSharedState)("reactions-storage",(function(){return new Map})),d=(0,a.makeSharedState)("reactions-config",(function(){return{config:void 0}})),v=function(t){(0,c.isDebugEnabled)()&&console.log(t),Object.entries(t).forEach((function(t){var e=(0,i.__read)(t,2),n=e[0],a=e[1],c=(0,o.validateReactionSetPayloaditems)(a,n);if(c)(0,u.reactionLogError)({error:c.error});else{var d=a.map((function(t){return(0,i.__assign)((0,i.__assign)({},t),{title:(0,r.decodeHTMLEntities)(t.title)})}));l().set(n,(0,o.prepareReactionMenuSet)(n,d,{imageMenuSize:s.SIZE_96,imagePreviewSize:s.SIZE_32,imageStoryPanelSize:s.SIZE_128,imageStoryPreviewSize:s.SIZE_40}))}}))},f=function(t){var e=l().get(t);if(e)return e;var n=new Error("Reaction set not found: "+t);(0,u.reactionLogError)({error:n})},g=function(t){(0,c.isDebugEnabled)()&&console.log(t);var e=(0,o.parseReactionMenuConfig)(t);e?d().config=e:console.warn("Reactions: invalid menu config passed",t)},m=function(){var t;return null===(t=d())||void 0===t?void 0:t.config}},740672:(t,e,n)=>{"use strict";n.d(e,{isValidEnvironment:()=>a,preloadImage:()=>u,usePrevious:()=>s,usePreviousRef:()=>c,isValidButtonTitleVariant:()=>d,isValidButtonStyleVariant:()=>v});var i=n(667294),r=n(1925),o=n(54789),a=function(){var t,e,n;return"function"==typeof(null===(t=window.cur)||void 0===t?void 0:t.viewAsBox)?(window.cur.viewAsBox(),!1):!(window.vk.widget&&!window.vk.id)||(null===(n=null===(e=window.Widgets)||void 0===e?void 0:e.oauth)||void 0===n||n.call(e),!1)},u=function(t){return new Promise((function(e,n){var i=new Image;i.src=t,i.onload=function(){return e()},i.onerror=function(){return n()}}))},s=function(t){var e=(0,i.useRef)(t);return(0,i.useEffect)((function(){e.current=t})),e.current},c=function(t){var e=(0,i.useRef)(t);return(0,i.useEffect)((function(){e.current=t})),e},l=Object.values(o.ButtonStyleVariant),d=function(t){return r.ReactionMenuTitleVariants.includes(t)},v=function(t){return l.includes(t)}},130273:(t,e,n)=>{"use strict";n.d(e,{postRenderReactionsInit:()=>L});var i=n(570655),r=n(330752),o=n(659397),a=n(613327),u=n(315544),s=n(964141),c=n(465864),l=n(485207),d=n(301718),v=n(908706),f=n(672544),g=n(665872),m=n(267740),p=n(96535),_=n(928634),R=n(892239),w=n(404608),b=n(385667),I=function(t,e,n){var i;void 0===n&&(n=null===(i=window.cur)||void 0===i?void 0:i.wallTpl);var r=null==n?void 0:n[t];if(r)return(0,s.stripPercentVars)((0,u.rs)(r,e));console.warn("renderTemplate: missing template '"+t+"'",n)},S=function(t){for(var e=t.isUserAction,n=void 0!==e&&e,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];n?console.error.apply(console,(0,i.__spreadArray)([],(0,i.__read)(r))):(0,l.isDebugEnabled)()&&console.warn.apply(console,(0,i.__spreadArray)([],(0,i.__read)(r)))};var E=function(t,e,n){var i=n.isActionStatusBarVisible,r=n.isReactionsPreviewVisible,a=n.positionTrackingEnd,s=function(t,e){var n,i,r=(0,f.getLikeWrap)(t);if(r){var o=(0,p.getPostElem)(e,r),a=null==o?void 0:o.querySelector('[data-section-ref="post-action-status-bar"]');if(a)return{actionStatusBar:a};var s=(0,_.isWkLayerWallPostOpen)()?null===(n=window.wkcur)||void 0===n?void 0:n.wallTpl:null===(i=window.cur)||void 0===i?void 0:i.wallTpl,c=(0,u.se)(I("post_action_status_bar",{class:"PostActionStatusBar--hidden"},s));if(c)return(0,u.domInsertBefore)(c,r),{actionStatusBar:c}}}(t,e.postFullId);if(s){var c=s.actionStatusBar;if(c.classList.toggle("PostActionStatusBar--hidden",!i),i&&!(0,f.getPreviewElem)(t)){var l=function(t,e,n){var i,r;void 0===n&&(n={});var a=(0,_.isWkLayerWallPostOpen)()?null===(i=window.wkcur)||void 0===i?void 0:i.wallTpl:null===(r=window.cur)||void 0===r?void 0:r.wallTpl,u=(0,o.classNames)({"ReactionsPreview--empty":!t,"ReactionsPreview--isInActionStatusBar":!!n.isInActionStatusBar});return I("post_reactions_preview",{class:u,object_raw:e},a)}(r,t,{isInActionStatusBar:!0});c.prepend((0,u.se)(l))}if(a){var d=(0,f.getLikeBtnElem)(t);null==a||a(d)}}else S({},"Unable to init ActionStatusBar in post",e)},y=function(t){if(function(t){return void 0!==t.counts}(t)){var e=(0,c.likePostObjectId)(t.postFullId),n=(0,p.getPostElem)(t.postFullId,(0,f.getLikeWrap)(e));n||S(t,"Missing post element for reactions preview update",{payload:t,likeWrap:(0,f.getLikeWrap)(e)});var i=(0,f.getLikeBtnElem)(e);if(i){var r=(0,d.reactionsElemPayload)(i),o=null==r?void 0:r.counts;A({elemPayload:r,likeBtnElem:i,likeObjectId:e,payload:t}),P({countsPrevious:o,likeBtnElem:i,likeObjectId:e,payload:t,postEl:n})}else S(t,"Unable to find reactions button",{likeObjectId:e})}else S(t,"Counts is invalid or missing")},A=function(t){var e=t.elemPayload,n=t.likeBtnElem,i=t.likeObjectId,o=t.payload,a=o.counts;if(!!o.isQueueUpdate&&function(t){var e=(0,r.getLastOwnReactionChangeTime)(t);if(!e)return!1;var n=e+1e4;return Date.now()<n}(n))(0,l.isDebugEnabled)()&&console.log("Ignoring reactions update from queue",o);else{if(e){var u=e.counts,s=e.reactionSetId,c=(0,b.getReactionSet)(s);if((0,g.isReactionsFullUpdatePayload)(o)){var v=o.reactionIdState.reactionId;c&&(0,r.updateReactionButtonForCurrentReaction)(n,v,c,o.isUserAction)}c&&((0,r.updateReactionButtonCounts)(n,c,o.isUserAction,a,u),(0,r.updateReactionButtonContainerForCounts)(n,a))}if((0,g.isReactionsFullUpdatePayload)(o)){v=o.reactionIdState.reactionId;(0,r.setDataCurrentId)(n,v),o.isUserAction&&(null==e?void 0:e.objectRaw)&&(0,R.emitDataUpdate)(e.objectRaw,{currentReactionId:v})}(0,d.updateReactionsButtonForCounts)(i,{counts:a})}},P=function(t){var e=t.countsPrevious,n=t.likeBtnElem,i=t.likeObjectId,r=t.payload,o=t.postEl,u=r.counts,s=r.previewVisibility,c=function(t,e){if((0,v.isIntentPreviewInActionStatusBar)(t))return{previewVariant:w.PreviewVariantActionStatusBar};if((0,v.isIntentPreviewHidden)(t))return{previewVariant:w.PreviewVariantHidden};if((0,v.isIntentPreviewUseCurrent)(t)){var n=(0,d.getPreviewVariantForLikeBtn)(e);if(n)return{previewVariant:n}}}(void 0===s?v.previewVisibilityUseCurrent:s,n);if(c){var l=c.previewVariant,f=(0,v.isVariantInActionStatusBar)(l),g=(0,d.shouldReactionsPreviewBeVisible)(u),m=(0,v.isVariantHidden)(l)||f&&!g;if(f){var p=void 0;r.isPrimaryLikeButtonClick&&!r.isFromWkLayer&&(p=(0,a.preservePositionBetween)(n).start());var _=g;null==o||o.classList.toggle("post--withActionStatusBar",_),E(i,r,{isActionStatusBarVisible:_,isReactionsPreviewVisible:g,positionTrackingEnd:p})}m||(0,d.updateReactionsPreview)(i,{counts:u,countsPrevious:e})}},C=function(t){if(!l.ENABLED_IN_POST_REPLY)return!1;var e=t.counts;if(e){var n=(0,c.likeReplyObjectId)(t.replyFullId);(0,d.updateReactionsPreview)(n,{counts:e,countsPrevious:void 0}),(0,d.updateReactionsButtonForCounts)(n,{counts:e})}},L=function(){var t=[(0,m.registerUniqueListener)("wall-post-action-status-bar",m.WallDataEvents.post_reactions_counts_update,y),(0,m.registerUniqueListener)("wall-reply-reactions-counts",m.WallDataEvents.reply_reactions_counts_update,C)];return{onDestroy:function(){t.forEach((function(t){t()})),t=[]}}}},267740:(t,e,n)=>{"use strict";n.d(e,{WallDataEvents:()=>i.WallDataEvents,registerUniqueListener:()=>i.registerUniqueListener});var i=n(453580)},96535:(t,e,n)=>{"use strict";n.d(e,{getPostElem:()=>i,replyUserImageLinkClosest:()=>r,replyUserImageImg:()=>o});var i=function(t,e){var n,i;return null!==(i=null!==(n=function(t){var e;if("string"==typeof t)return null!==(e=document.querySelector("#post"+t))&&void 0!==e?e:void 0}(t))&&void 0!==n?n:null==e?void 0:e.closest("._post, .wl_post"))&&void 0!==i?i:void 0},r=function(t){var e;return null!==(e=t.closest(".reply_image, ._reply_image"))&&void 0!==e?e:void 0},o=function(t){var e;return null!==(e=t.querySelector("img.reply_img"))&&void 0!==e?e:void 0}},928634:(t,e,n)=>{"use strict";n.d(e,{isWkLayerWallPostOpen:()=>i});var i=function(){return!!window.cur.wallLayer}}}]);try{stManager.done("dist/90f8cf219bb6d5a2f2ecd964325e4940.db1afa6d3485d6c35bfa.js")}catch(t){}